package cn.base.day08;

public class Test05 {
    public static void main(String[] args) {
        String s1 = "186220753032207";
        String s2 = s1.substring(0, 3);
        String s3 = s1.substring(7);
        System.out.println(s2 + "****" + s3);
        String s4 = s1.replace("2207", "****");
        System.out.println(s4);

        //切割字符串
        String a = "2023-04-24";
        String[] sp = a.split("-");
        for (int i = 0; i < sp.length; i++) {
            System.out.println(sp[i]);
        }
        String b = "123.jpg";
        //分割的字符 . 要加两个反斜杠 \\
        String[] p = b.split("\\.");
        System.out.println(p.length);
    }
}
